package com.leoman.plz_p.adapter;

import android.content.Context;
import android.view.View;

import com.leoman.plz_p.R;
import com.leoman.plz_p.module.bean.TestBean;
import com.leoman.plz_p.views.WebActivity;

import cn.com.corelib.utils.adapter.BaseAdapterHelper;
import cn.com.corelib.utils.adapter.normal.QuickAdapter;

/**
 * Created by guoh on 2018/9/26.
 */
public class CourseTestClassAdapter extends QuickAdapter<TestBean.ListBeanX.ListBean> {


    public CourseTestClassAdapter(Context context) {
        super(context, R.layout.item_test_class);
    }

    @Override
    protected void convert(BaseAdapterHelper helper, final TestBean.ListBeanX.ListBean item, int position) {
        helper.setText(R.id.tv_title_name,item.getName());
        helper.setOnClickListener(R.id.tv_title_name, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.startActivity(WebActivity.getLaunchIntent(context, "", item.getUrl(), "", true, true));
            }
        });
    }
}
